package elearning.record.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import elearning.record.entity.Browse;

public class BrowseDao extends HibernateDaoSupport{

	public Browse findByUidAndVideoId(Integer uid, Integer videoid) {
		String hql="from Browse where userId = ? and videoId = ?";
		@SuppressWarnings("unchecked")
		List<Browse> list = this.getHibernateTemplate().find(hql,uid,videoid);
		if(list.size()>0&&list!=null){
			return list.get(0);
		}
		return null;
	}

	public void update(Browse browse) {
		this.getHibernateTemplate().update(browse);
	}

	public void save(Browse browse) {
		this.getHibernateTemplate().save(browse);
	}

}
